package com.dotflat.fin.controller;

import com.dotflat.fin.PO.WalletPO;
import com.dotflat.fin.domain.WalletFlow;
import com.dotflat.fin.service.WalletFlowService;
import com.dotflat.rest.controller.RestfulBaseController;
import com.matt.commons.model.StatusResponse;
import com.matt.foundation.model.ErrorCode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import static com.matt.foundation.constant.CommonConstant.TICKET;

/**
 * @author ：Ron
 * @date ：Created in 11/5/2020 7:36 PM
 */
@RestController
@RequestMapping("/mobile/walletFlow")
@Api(tags = "财务 - 客户钱包流水")
public class WalletFlowController extends RestfulBaseController<WalletFlow, WalletFlowService, WalletPO> {

    @Autowired
    @Override
    public void setBaseService(WalletFlowService service){
        this.baseService = service;
    }


    @ApiOperation(value = "增加一条记录", hidden = true)
    @PostMapping()
    public StatusResponse add(@RequestHeader(TICKET) String ticket, WalletPO param){
        return StatusResponse.error(ErrorCode.STAFF_HAS_NO_ROLE, "权限不够");
    }


    @ApiOperation(value = "逻辑删除一个或多个对象", hidden = true)
    @DeleteMapping()
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", name = "ticket", value = "票据", required = true, dataType = "string"),
            @ApiImplicitParam(paramType = "formData", name = "ids", value = "对象id数组", required = false, dataType = "string[]"),
            @ApiImplicitParam(paramType = "formData", name = "id", value = "对象id， 和ids二选一", required = false, dataType = "string")
    })
    public StatusResponse delete(@RequestHeader(TICKET) String ticket, String[] ids, String id ){
        return StatusResponse.error(ErrorCode.STAFF_HAS_NO_ROLE, "权限不够");
    }

}
